<template>
    <div class="pay" v-for="(item,key) in list" :key="key">
        <div class="content">
        <span>消费描述：</span>{{item.content}}
        </div>
        <div class="total">
            <span>消费金额：</span>￥{{item.total}}
        </div>
        <div class="time">
            <span>消费时间：</span>{{item.createtime_text}}
        </div>
    </div>
</template>

<script setup>
import { onBeforeMount } from 'vue';

    const {proxy} = getCurrentInstance()

    let list = ref([])

    onBeforeMount(()=>{
        RecordData()
    })

    const RecordData = async () =>
    {
        var params = {
            busid: proxy.$business.value.id
        }

        var result = await proxy.$POST({
            url: '/business/record',
            params
        })

        if(result.code == 0)
        {
            proxy.$fail(result.msg)
            return false
        }

        list.value = result.data
    }
</script>

<style scoped>
    .pay{
        background-color:rgba(238, 237, 237, 0.963);
        margin: 8px 0;
    }
</style>